Batch Mode

I have a string variable EXEC_MODE that is defined in an include file. When running in batch mode, I want to assign
EXEC_MODE = "Maintenance" so that subsequent scripts run will check this value and proceed to print to a file or the console.

From my batch file:

"C:\Program Files (x86)\IBM\Rational\DOORS\9.3\bin\doors.exe" -u "username" -P "password" -batch "C:\..\Maintenance.dxl"

will adding the following argument accomplish this?
-cli " evalTop_(\"EXEC_MODE = \" \"Maintenance\" ) "
lsand - Wed Apr 27 14:07:47 EDT 2011

Re: Batch Mode
llandale - Wed Apr 27 16:23:17 EDT 2011

I'm guessing that when ever some other routine DXL runs it will get interpret errors because EXEC_MODE isn't defined for THAT dxl. That's easy enough to find out.

If all the subsequent scripts are going to run under the same DOORS user as the one setting the mode to Maintenance, then you can use what I call 'Custom User Properties' to communicate with them:

// Control program does this:
User uCurr = find()   // My user handle
set(uCurr, "Execute_Mode", "Maintenance")
// Subordinate scripts do this:'
User uCurr = find()
string Mode = get(uCurr, "Execute_Mode")
if    (Mode == "")            then I am out of control
elseif(Mode == "Maintenance") then whatever
elseif(Mode == "Report")      then whatever


Look in the DXL Manual for command "isAttribute" and the 4 commands nearby.

 

 

  • Louie

 

 

Re: Batch Mode
Mathias Mamsch - Thu Apr 28 08:51:59 EDT 2011

Did you consider using isBatch to actually check if you are running in batch mode instead of setting a variable? Why not include the checks in each script using an include file and a function:
 

if (am_I_in_maintenance_mode() == true )  { ... } else { ... }

 


where the am_I_in_maintenance_mode function is defined in your include and will do all the checks to determine what shall be done. By the way, you don't need to use evalTop_ for -cli ... Everything you specify on the commandline will be run in top level context anyway (and stick around for other DXL programs). Therefore you only would need to do:

 

 

 

doors.exe -cli "int whoo=4"



and the whoo variable will be globally available.

Regards, Mathias



 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Batch Mode
lsand - Thu Apr 28 10:40:57 EDT 2011

Mathias Mamsch - Thu Apr 28 08:51:59 EDT 2011

Did you consider using isBatch to actually check if you are running in batch mode instead of setting a variable? Why not include the checks in each script using an include file and a function:
 

if (am_I_in_maintenance_mode() == true )  { ... } else { ... }

 


where the am_I_in_maintenance_mode function is defined in your include and will do all the checks to determine what shall be done. By the way, you don't need to use evalTop_ for -cli ... Everything you specify on the commandline will be run in top level context anyway (and stick around for other DXL programs). Therefore you only would need to do:

 

 

 

doors.exe -cli "int whoo=4"



and the whoo variable will be globally available.

Regards, Mathias



 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

thank you, I did not know there was an isBatch function! thanks louie, mathias!